image=imread("fig6.tif");
temp=im2double(image);
% 添加高斯噪声
J1 = imnoise(image,'gaussian',0,0.01);
J2 = imnoise(image,'gaussian',0,0.05);
% 添加椒盐噪声
K1 = imnoise(image,'salt & pepper',0.01);
K2 = imnoise(image,'salt & pepper',0.05);

% 显示图像
subplot(2,3,1),imshow(image),title('Original Image');
subplot(2,3,2),imshow(J1),title('Gaussian Noise (0.01)');
subplot(2,3,3),imshow(J2),title('Gaussian Noise (0.05)');
subplot(2,3,4),imshow(K1),title('Salt & Pepper Noise (0.01)');
subplot(2,3,5),imshow(K2),title('Salt & Pepper Noise (0.05)');